// var targetUrl = 'http://192.168.1.154:8089/msp/'
var targetUrl = 'http://120.76.227.21:10166/WisdomMunicipal/'

const proxyTableJson = {
  'api': {
    filter: ['/api', '/download'],
    target: targetUrl,
    changeOrigin: true
  },
  'invoke': {
    filter: (pathname, req) => {
      return pathname.match('^(\/proxy)(\/[1-9a-zA-Z\.]+)*(\.(img|jdn|jup|vdt|vdp))?$')
    },
    pathRewrite: {
      '^/proxy': ''
    },
    target: targetUrl,
    changeOrigin: true
  }
}

module.exports = {
  baseUrl: './',
  outputDir: 'dist',
  devServer: {
    host: '0.0.0.0',
    port: 3000,
    https: false,
    hotOnly: false,
    disableHostCheck: true,
    proxy: proxyTableJson,
    before: app => {}
  }
}
